<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="superviseMenu" />
<meta name="nav" content="2" />
<meta name="acc" content="0" />
<title>中间交工验收申请</title>
<script type="text/javascript">
	function getcheckResult() {
		var date = new Date();
		$.get("${ctx}/business/mdetect/issue!listall.action?projectId=${projectId}&decorator=open&update=true&confirm=true&time="
								+ date, function(data) {
							$("#problem").html(data);
						});
	}
	$(document).ready(
			function() {
				$("#inputForm").validate({
					event : "blur",
					isTip : true
				});
				$("#dealDate").addClass("Wate").bind("click", function() {
					WdatePicker({
						skin : 'whyGreen',
						dateFmt : 'yyyy-MM-dd'
					});
				});

				$("#reportDate").addClass("Wate").bind("click", function() {
					WdatePicker({
						skin : 'whyGreen',
						dateFmt : 'yyyy-MM-dd'
					});
				});
				var date = new Date();
				$.get(
						"${ctx}/business/history/history!info.action?key=${id}&time="
								+ date, function(data) {
							$("#frame").html(data);
						});
				getcheckResult();
				$("#add").click(function() {
					var projectId = $("input[name='projectId']").val();
					//var cid = $("input[name='cid']").val();
					var dealDate = $("input[name='dealDate']").val();
					var content = $("textarea[name='content1']").val();
					var dealContent = $("textarea[name='dealContent']").val();
					var type = $("select[name='type1']").val();
					var remark = $("textarea[name='remark1']").val();
					$.post("${ctx}/business/mdetect/issue!save.action", {
						projId : projectId,
						content : content,
						dealContent : dealContent,
						dealDate : dealDate,
						type : type,
						remark : remark
					}, function(data) {
						getcheckResult();
					});
				});
			});
	function updateProblem(id) {
		var titleName = '问题修改';
		var url = appConfig.contPath
				+ "/business/mdetect/issue!input.action?id=" + id;
		showWindow(titleName, url, {
			width : 740,
			height : 350
		});
	}
	
	function deleProblem(id) {
		if(confirm("确定删除？")){
		$.get("${ctx}/business/mdetect/issue!dele.action",{id:id},function(data){
			alert("删除成功！");
			getcheckResult();
		});
		}
	}
	
	function close() {
		$.window.closeAll();
	}
</script>
</head>
<body>
	<form action="${ctx}/business/middledetect!submit.action" method="post"
		id="inputForm" class="yform">
		<div id="caption">
			<h6>办理结果|中间交工验收存在问题</h6>
		</div>
		<input type="hidden" id="id" name="id" value="${id }"> <input
			type="hidden" name="status" id="status" value="06"> <input
			type="hidden" name="projectId" id="projectId" value="${projectId}">
		<input type="hidden" name="taskId" id="taskId"
			value="${(empty taskid)?taskId : taskid}"> <input
			type="hidden" id="taskid" name="taskid"
			value="${(empty taskid)?taskId : taskid}"> <input
			type="hidden" name="fid" id="fid" value="${id}">

		<table class="noborder">
			<tr class="type-text">
				<td>工程名称</td>
				<td colspan="3"><input type="text" readonly="readonly"
					value='<pt:labels type="proj" argument1="${projectId}" single="true"></pt:labels>'>
				</td>
			</tr>
			<tr class="type-text">
				<td>问题类型</td>
				<td><pt:code category="3011" name="type1"></pt:code></td>
				<td>处理时间</td>
				<td><input type="text" name="dealDate" id="dealDate"></td>
			</tr>
			<tr class="type-text">
				<td>概要描述</td>
				<td colspan="3"><textarea name="content1" id="content1"></textarea></td>
			</tr>
			<tr class="type-text">
				<td>处理措施</td>
				<td colspan="3"><textarea name="dealContent" id="dealContent"></textarea>
				</td>
			</tr>
			<tr class="type-text">
				<td>备注</td>
				<td colspan="3"><textarea name="remark1" id="remark1"></textarea></td>
			</tr>
			<tr class="type-text">
				<td colspan="4" align="center"><div class="type-button">
				<input type="button" value="添加" id="add" name="add">
				<input type="reset" value="重置" id="reset"> 
					</div></td>
			</tr>
		</table>
		<div id="caption">
			<h6>审核记录</h6>
		</div>
		<div id="frame"></div>
		<div id="caption">
			<h6>中间交工验收问题情况汇报列表</h6>
		</div>
		<div id="problem"></div>
		<div id="caption">
			<h6>填写办理结果意见</h6>
		</div>
		<div>
			<table class="noborder">
				<tr class="type-text">
					<td width="80">审核意见</td>
					<td align="left"><textarea name="view" id="view" rows="3"></textarea></td>
				</tr>
			</table>
		</div>
		<div class="type-button">
			<input type="submit" class="submit" value="提交"
				onclick="return isProcess();" />
			<a
				href="javascript:showWindow('查看申请资料','${ctx}/business/mdetect/petition!input.action?fid=${id}&projectId=${projectId}&decorator=open&confirm=true')">查看申请资料</a>
			</div>
	</form>
</body>
</html>